home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1989 …il & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / MPW Goodies / Interfaces / PInterfaces / SCSI.p < prev    next >
Encoding:
Text File  |  1988-11-30  |  4.2 KB  |  119 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Tuesday, August 2, 1988 at 10:24 AM
  3.     SCSI.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.  1986-1988
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT SCSI;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingSCSI}
  21. {$SETC UsingSCSI := 1}
  22.  
  23. {$I+}
  24. {$SETC SCSIIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingTypes}
  27. {$I $$Shell(PInterfaces)Types.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := SCSIIncludes}
  30.  
  31. CONST
  32. scInc = 1;
  33. scNoInc = 2;
  34. scAdd = 3;
  35. scMove = 4;
  36. scLoop = 5;
  37. scNop = 6;
  38. scStop = 7;
  39. scComp = 8;
  40. scCommErr = 2;                              {communications error, operation timeout}
  41. scArbNBErr = 3;                             {arbitration timeout waiting for not BSY}
  42. scBadParmsErr = 4;                          {bad parameter or TIB opcode}
  43. scPhaseErr = 5;                             {SCSI bus not in correct phase for attempted operation}
  44. scCompareErr = 6;                           {data compare error}
  45. scMgrBusyErr = 7;                           {SCSI Manager busy }
  46. scSequenceErr = 8;                          {attempted operation is out of sequence}
  47. scBusTOErr = 9;                             {CPU bus timeout}
  48. scComplPhaseErr = 10;                       {SCSI bus wasn't in Status phase}
  49. sbSIGWord = $4552;
  50. pMapSIG = $504D;
  51.  
  52.  
  53. TYPE
  54.  
  55. Block0 = PACKED RECORD
  56.     sbSig: INTEGER;                         {unique value for SCSI block 0}
  57.     sbBlkSize: INTEGER;                     {block size of device}
  58.     sbBlkCount: LONGINT;                    {number of blocks on device}
  59.     sbDevType: INTEGER;                     {device type}
  60.     sbDevId: INTEGER;                       {device id}
  61.     sbData: LONGINT;                        {not used}
  62.     sbDrvrCount: INTEGER;                   {driver descriptor count}
  63.     ddBlock: LONGINT;                       {1st driver's starting block}
  64.     ddSize: INTEGER;                        {size of 1st driver (512-byte blks)}
  65.     ddType: INTEGER;                        {system type (1 for Mac+)}
  66.     ddPad: ARRAY [0..242] OF INTEGER;       {ARRAY[0..242] OF INTEGER; not used}
  67.     END;
  68.  
  69. Partition = PACKED RECORD
  70.     pmSig: INTEGER;                         {unique value for map entry blk}
  71.     pmSigPad: INTEGER;                      {currently unused}
  72.     pmMapBlkCnt: LONGINT;                   {# of blks in partition map}
  73.     pmPyPartStart: LONGINT;                 {physical start blk of partition}
  74.     pmPartBlkCnt: LONGINT;                  {# of blks in this partition}
  75.     pmPartName: ARRAY [0..31] OF CHAR;      {ASCII partition name}
  76.     pmParType: ARRAY [0..31] OF CHAR;       {ASCII partition type}
  77.     pmLgDataStart: LONGINT;                 {log. # of partition's 1st data blk}
  78.     pmDataCnt: LONGINT;                     {# of blks in partition's data area}
  79.     pmPartStatus: LONGINT;                  {bit field for partition status}
  80.     pmLgBootStart: LONGINT;                 {log. blk of partition's boot code}
  81.     pmBootSize: LONGINT;                    {number of bytes in boot code}
  82.     pmBootAddr: LONGINT;                    {memory load address of boot code}
  83.     pmBootAddr2: LONGINT;                   {currently unused}
  84.     pmBootEntry: LONGINT;                   {entry point of boot code}
  85.     pmBootEntry2: LONGINT;                  {currently unused}
  86.     pmBootCksum: LONGINT;                   {checksum of boot code}
  87.     pmProcessor: ARRAY [0..15] OF CHAR;     {ASCII for the processor type}
  88.     pmPad: ARRAY [0..187] OF INTEGER;       {512 bytes long currently unused}
  89.     END;
  90.  
  91. SCSIInstr = RECORD
  92.     scOpcode: INTEGER;
  93.     scParam1: LONGINT;
  94.     scParam2: LONGINT;
  95.     END;
  96.  
  97.  
  98.  
  99. FUNCTION SCSIReset: OSErr;
  100. FUNCTION SCSIGet: OSErr;
  101. FUNCTION SCSISelect(targetID: INTEGER): OSErr;
  102. FUNCTION SCSICmd(buffer: Ptr;count: INTEGER): OSErr;
  103. FUNCTION SCSIRead(tibPtr: Ptr): OSErr;
  104. FUNCTION SCSIRBlind(tibPtr: Ptr): OSErr;
  105. FUNCTION SCSIWrite(tibPtr: Ptr): OSErr;
  106. FUNCTION SCSIWBlind(tibPtr: Ptr): OSErr;
  107. FUNCTION SCSIComplete(VAR stat: INTEGER;VAR message: INTEGER;wait: LONGINT): OSErr;
  108. FUNCTION SCSIStat: INTEGER;
  109. FUNCTION SCSISelAtn(targetID: INTEGER): OSErr;
  110. FUNCTION SCSIMsgIn(VAR message: INTEGER): OSErr;
  111. FUNCTION SCSIMsgOut(message: INTEGER): OSErr;
  112.  
  113. {$ENDC}    { UsingSCSI }
  114.  
  115. {$IFC NOT UsingIncludes}
  116.     END.
  117. {$ENDC}
  118.  
  119.